<template>

        <el-row>
          <el-col :span="12">
            <el-card header="商品信息">
              <el-table :data="productData" border>
                <el-table-column label="" prop="name"></el-table-column>
                <el-table-column label="总数"  prop="total"></el-table-column>
                <el-table-column label="本年"  prop="year"></el-table-column>
                <el-table-column label="本月"  prop="month"></el-table-column>
                <el-table-column label="本周"  prop="week"></el-table-column>
                <el-table-column label="昨天"  prop="yesterday"></el-table-column>
                <el-table-column label="今天" prop="today"></el-table-column>
              </el-table>
            </el-card>
          </el-col>
          <el-col :span="12">
            <el-card header="订单信息">
              <el-table :data="orderData" border>
                <el-table-column label="" prop="name"></el-table-column>
                <el-table-column label="总数"  prop="total"></el-table-column>
                <el-table-column label="本年"  prop="year"></el-table-column>
                <el-table-column label="本月"  prop="month"></el-table-column>
                <el-table-column label="本周"  prop="week"></el-table-column>
                <el-table-column label="昨天"  prop="yesterday"></el-table-column>
                <el-table-column label="今天" prop="today"></el-table-column>
              </el-table>
            </el-card>
          </el-col>
        </el-row>


</template>

<script>
import {
  queryOrderReport,
  queryProductReport,
} from "@/api/welcome/orderwelcome.js";

export default {
      name: "OrderProductWelcome",
  data() {
    return {
      productData: [
        { name: '有效商品数量',  total: null,year: null, month: null, week: null, yesterday: null, today: null },
        { name: '待审核商品数量', total: null,  year: null, month: null, week: null, yesterday: null, today: null },
        { name: '待上架商品数量',  total: null, year: null, month: null, week: null, yesterday: null, today: null },
        { name: '已上架商品数量',  total: null, year: null, month: null, week: null, yesterday: null, today: null }
      ],
      orderData: [
        { name: '有效订单数量',   total: null,year: null, month: null, week: null, yesterday: null, today: null },
        { name: '待支付订单数量',  total: null,year: null, month: null, week: null, yesterday: null, today: null },
        { name: '待发货订单数量',  total: null, year: null, month: null, week: null, yesterday: null, today: null },
        { name: '已完成订单数量',  total: null,year: null, month: null, week: null, yesterday: null, today: null }
      ]
    };
  },
    created() {
    this.getList();
  },
    methods: {
            getList() {
      queryOrderReport(this.queryParams).then((response) => {
        var returndata= response.data;
        this.orderData[0].total =     returndata.count;
        this.orderData[0].year =      returndata.yearCount;
        this.orderData[0].month =     returndata.monthCount;
        this.orderData[0].week =      returndata.weekCount;
        this.orderData[0].yesterday = returndata.beforeCount;
        this.orderData[0].today =     returndata.currentCount;

        this.orderData[1].total =     returndata.pendingCount;
        this.orderData[1].year =      returndata.yearPendingCount;
        this.orderData[1].month =     returndata.monthPendingCount;
        this.orderData[1].week =      returndata.weekPendingCount;
        this.orderData[1].yesterday = returndata.beforePendingCount;
        this.orderData[1].today =     returndata.currentPendingCount;

        this.orderData[2].total =     returndata.pendedCount;
        this.orderData[2].year =      returndata.yearPendedCount;
        this.orderData[2].month =     returndata.monthPendedCount;
        this.orderData[2].week =      returndata.weekPendedCount;
        this.orderData[2].yesterday = returndata.beforePendedCount;
        this.orderData[2].today =     returndata.currentPendedCount;

        this.orderData[3].total =     returndata.complateCount;
        this.orderData[3].year =      returndata.yearComplateCount;
        this.orderData[3].month =     returndata.monthComplateCount;
        this.orderData[3].week =      returndata.weekComplateCount;
        this.orderData[3].yesterday = returndata.beforeComplateCount;
        this.orderData[3].today =     returndata.currentComplateCount;
       
      });

            queryProductReport(this.queryParams).then((response) => {
        var returndata= response.data;
        this.productData[0].total =     returndata.count;
        this.productData[0].year =      returndata.yearCount;
        this.productData[0].month =     returndata.monthCount;
        this.productData[0].week =      returndata.weekCount;
        this.productData[0].yesterday = returndata.beforeCount;
        this.productData[0].today =     returndata.currentCount;

        this.productData[1].total =     returndata.pendingCount;
        this.productData[1].year =      returndata.yearPendingCount;
        this.productData[1].month =     returndata.monthPendingCount;
        this.productData[1].week =      returndata.weekPendingCount;
        this.productData[1].yesterday = returndata.beforePendingCount;
        this.productData[1].today =     returndata.currentPendingCount;

        this.productData[2].total =     returndata.pendedCount;
        this.productData[2].year =      returndata.yearPendedCount;
        this.productData[2].month =     returndata.monthPendedCount;
        this.productData[2].week =      returndata.weekPendedCount;
        this.productData[2].yesterday = returndata.beforePendedCount;
        this.productData[2].today =     returndata.currentPendedCount;

        this.productData[3].total =     returndata.complateCount;
        this.productData[3].year =      returndata.yearComplateCount;
        this.productData[3].month =     returndata.monthComplateCount;
        this.productData[3].week =      returndata.weekComplateCount;
        this.productData[3].yesterday = returndata.beforeComplateCount;
        this.productData[3].today =     returndata.currentComplateCount;
      });
    },
    }
};
</script>


